﻿using Com.Ctrip.Framework.Apollo;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ManaMaple.Apollo
{
    public class ApolloAppsettingsHelper
    {
        private static IConfiguration Config { set; get; }

        public static void SetConfiguration(IConfiguration Configs)
        {
            Config = Configs;
        }

        public static string GetConfig(string key)
        {
            var value = GetConfig<string>(key);
            return value;
        }
        public static T GetConfig<T>(string key)
        {
            //T value1 = Config.GetValue<T>(key);
            T value = Config.GetSection(key).Get<T>();
            return value;
        }
    }
}
